<template>
  <div>
    <MapBaidu ref="mapRef" />
  </div>
</template>

<script>
import { getWorkAreaMap } from '@/api/employee'
export default {
  data() {
    return {
      mapInfo: {}
    }
  },
  created() {
    this.initWorkAreaMap()
  },
  methods: {
    async initWorkAreaMap() {
      const res = await getWorkAreaMap(this.$route.query.id)
      // console.log(res)
      this.mapInfo = res
      // this.initMap()
      this.$nextTick(() => {
        this.$refs.mapRef.initMap(res)
      })
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
